package com.model;

import lombok.Data;

import java.net.URL;

@Data
public class AddressRes {
    private boolean status;
    private String message;
    private Data data;

    @lombok.Data
    // Inner class for the 'data' object
    public static class Data {
        private String key;
        private String name;
        private String pathname;
        private String origin_name;
        private String size;
        private String mimetype;
        private String extension;
        private String md5;
        private String sha1;
        private Links links;

        @lombok.Data
        public static class Links {
            private URL url;
            private String html;
            private String bbcode;
            private String markdown;
            private String markdown_with_link;
            private URL thumbnail_url;
            private URL delete_url;
        }
    }

    // Main method to create an instance of AddressRes
    public static void main(String[] args) {
        AddressRes response = new AddressRes();
        response.setStatus(true);
        response.setMessage("上传成功");

        AddressRes.Data data = new AddressRes.Data();
        data.setKey("t5O6J6");
        data.setName("67e7758507eca.jpg");
        // ... (set other fields)

        AddressRes.Data.Links links = new AddressRes.Data.Links();
        try {
            links.setUrl(new URL("https://img.picui.cn/free/2025/03/29/67e7758507eca.jpg"));
            // ... (set other fields)
        } catch (Exception e) {
            e.printStackTrace();
        }

        data.setLinks(links);
        response.setData(data);

        // Now you have an object 'response' that represents the JSON data
    }
}
